package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.mini.miniaddress.MiniAddressQuery;
import com.uzai.console.entity.MiniAddress;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface MiniAddressMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(MiniAddress record);

    int insertSelective(MiniAddress record);

    MiniAddress selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateByIdSelective(MiniAddress record);

    int updateById(MiniAddress record);

    int updateIsNotDefault(@Param("type") Integer type, @Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<MiniAddress> findByList(Page<MiniAddress> page, @Param("query") MiniAddressQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<MiniAddress> findByList(@Param("query") MiniAddressQuery query);
}